/*
 * @Author: Setsuna
 * @Email: setsuna.xyz@qq.com
 * @FilePath: \src\utils\OSS-upload\ossClientCreator.ts
 * @Date: 2022-05-25 17:05:50
 * @LastEditTime: 2022-05-25 17:31:53
 */
const OSS = require('ali-oss')

export interface IOssConfig {
  accessKeyId: string;
  accessKeySecret: string;
  securityToken: string;
  region: string;
  bucket: string;
  endpoint: string;
  [propName: string]: any;
}

export default (ossConfig: IOssConfig) => {
  return new OSS({
    accessKeyId: ossConfig.accessKeyId,
    accessKeySecret: ossConfig.accessKeySecret,
    stsToken: ossConfig.securityToken,
    region: 'oss-accelerate',
    bucket: 'lzlj-jxsmh',
  })
}